package lsl.leetCode.year2023.test0201;

import lsl.leetCode.test1222.ListNode;

/**
 * @author Zed
 * @description
 * @date 2023/2/1 20:39
 */
public class test83 {
    public static void main(String[] args) {

    }

    public static ListNode deleteDuplicates(ListNode head) {
        if (head == null) {
            return null;
        }
        ListNode node = new ListNode(-1);
        ListNode cur = head;
        node.next = cur;
        while (cur.next != null) {
            if (cur.val == cur.next.val) {
                cur.next = cur.next.next;
            } else {
                cur = cur.next;
            }
        }
        return node.next;
    }
}
